<template>
	<!-- :style="{height:contentheightData}" -->
	<view class="pagesPlatform pagesPadding">
		<view class="content" v-if='centerIntroduction'>
			<rich-text :nodes="centerIntroduction" @itemclick="imageClick"></rich-text>
			
		</view>
		<pagesNoData v-else :heightData="contentheightData"></pagesNoData>
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	import {findAllFrontHomePage} from '@/api/platform/FrontHomePage.js'
	export default {
		name:"pagesPlatform",
		computed:{
			...mapState({
				logInType:state=>state.user.logInType  //1医生  2个人  普通
			})
		},
		data() {
			return {
				contentheightData:'calc(100vh - 658rpx)',
				centerIntroduction:''
			};
		},
		mounted(){
			
			this.findAllFrontHomePage()
		},
		methods:{
			findAllFrontHomePage(){
				findAllFrontHomePage().then(res=>{
					if(res.code==200){
						this.centerIntroduction=res.data[0].centerIntroduction
					}
				})
			},
			imageClick(e) {
				// 获取点击的元素和图片的src
				console.log('e',e)
				if(e.detail.node.name=='img'){
					let src =e.detail.node.attrs.src
					uni.previewImage({
						current: src, // 当前显示的图片链接
						urls: [src] // 需要预览的图片链接列表
					});
				}
			},
		}
	}
	
</script>

<style lang="scss" scoped>
.pagesPlatform{
	overflow: hidden;
	overflow-y: auto;
	.content{
		font-size: 28rpx;
		color: #646464;
		padding: 24rpx;
		box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0,0,0,0.08);
		border-radius: 8rpx;
		word-break:break-all;
		vertical-align: top;
		line-height: 44rpx;
		::v-deep img{
			max-width: 100% !important;
			max-height: 100% !important;
			display: block;
			margin: 5rpx auto ;
			border-radius: 8rpx;
		}
	}
}
</style>